package com.ruoyi.project.largeScreen.controller;

import com.ruoyi.project.largeScreen.domain.DeviceInfo;
import com.ruoyi.project.largeScreen.domain.MonitorInfoBaseOnDevice;
import com.ruoyi.project.largeScreen.domain.MonitorInfoBaseOnMonitor;
import com.ruoyi.project.largeScreen.domain.OriginMsg;
import com.ruoyi.project.largeScreen.service.LargeScreenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.sql.Timestamp;
import java.util.List;

@RestController
@RequestMapping("/largeScreen")
public class LargeScreenController {
    @Autowired
    private LargeScreenService largeScreenService;

    @GetMapping("/getMonitorInfoListBaseOnDevice")
    public List<MonitorInfoBaseOnDevice> getMonitorInfoListBaseOnDevice(){
        return largeScreenService.getMonitorInfoListBaseOnDevice();
    }

    @GetMapping("/getMonitorInfoListBaseOnMonitor")
    public List<MonitorInfoBaseOnMonitor> getMonitorInfoListBaseOnMonitor(){
        return largeScreenService.getMonitorInfoListBaseOnMonitor();
    }

    @GetMapping("/getDeviceInfoList")
    public List<DeviceInfo> getDeviceInfoList(){
        return largeScreenService.getDeviceInfoList();
    }

    @GetMapping("/getOriginMsgList")
    public List<OriginMsg> getOriginMsgList(@RequestParam(value = "startTime") Timestamp startTime, 
                                            @RequestParam(value = "endTime") Timestamp endTime)
    {
        return largeScreenService.getOriginMsgList(startTime, endTime);
    }
}
